package cosmos.properties;

import lodsve.core.properties.relaxedbind.annotations.EnableConfigurationProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

/**
 * .
 *
 * @author sunhao(sunhao.java @ gmail.com)
 * @version V1.0, 16/1/8 下午7:21
 */
@Configuration
@EnableConfigurationProperties(TestTestConfig.class)
public class TestConfig2 {

    @Bean
    public String test(TestTestConfig testTestConfig, Environment environment) {
        System.out.println(testTestConfig);
        System.out.println(testTestConfig.getSex().ordinal());
        String[] profiles = environment.getActiveProfiles();
        for (String profile : profiles) {
            System.out.println("active profile: " + profile);
        }

        return testTestConfig.getFuck();
    }
}
